package webcomponents;

import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;

public class radioButton {
	
	@FindBy(xpath = "/html/body/table/tbody/tr[2]/td/div/table/tbody/tr[2]/td[2]/form/input")
	WebElement buttonRed;
	
	@FindBy(xpath = "/html/body/table/tbody/tr[2]/td/div/table/tbody/tr[2]/td[2]/form/input[2]")
	WebElement buttonBlue;
	
	@FindBy(xpath = "/html/body/table/tbody/tr[2]/td/div/table/tbody/tr[2]/td[2]/form/input[3]")
	WebElement buttonGreen;

	@FindBy(xpath = "/html/body/table/tbody/tr[2]/td/div/table/tbody/tr[2]/td[2]/form/input[4]")
	WebElement buttonSubmit;
	

	
	public void chooseColor(String color)
	{
		if (color == "Red")
		{buttonRed.click();}
		else if (color == "Blue")
		{buttonBlue.click();}
		else if (color == "Green")
		{buttonGreen.click();}
	}
	
	public pageAfterSubmit clickSubmitButton ()
	{
		buttonSubmit.click();
		return new pageAfterSubmit();
	}
}
